package com.iwop.moto.service.impl;

import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.MTrademarkService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/8/24.
 */
@SuppressWarnings("serial")
@Service("mTrademarkService")
public class MTrademarkServiceImpl extends BaseService implements MTrademarkService {

    /**
     * 功能:新增商品品牌
     */
    @Override
    public void insertTrademark(SuperRecordModel SRModel) {
        getSqlSession().insert("MTrademarkMapper.insertTrdemark",SRModel);
    }

    /**
     * 功能:修改商品品牌
     */
    @Override
    public void upTrademark(SuperRecordModel SRModel) {
        getSqlSession().insert("MTrademarkMapper.upTrademark",SRModel);
    }

    /**
     * 功能:获取商品品牌列表
     */
    @Override
    public List getTrademark(SuperRecordModel SRModel) {
        List<Object> objects = getSqlSession().selectList("MTrademarkMapper.getTrademark", SRModel);
        return objects;
    }

    /**
     * 功能:删除商品品牌
     */
    @Override
    public void deleteTrademark(SuperRecordModel SRModel) {
        getSqlSession().update("MTrademarkMapper.deleteTrademark", SRModel);
    }

    @Override
    public List<SuperRecordModel> getTrademarkList() {
        return  getSqlSession().selectList("MTrademarkMapper.selectTrademarkList");
    }

    public void insertTrademarkDetail(SuperRecordModel SRModel) {
        getSqlSession().insert("MTrademarkDetailMapper.insert",SRModel);
    }

    @Override
    public void deleteTrademarkDetailByUserId(String user_id) {
        getSqlSession().delete("MTrademarkDetailMapper.delete", user_id);
    }

    @Override
    public List<SuperRecordModel> getTrademarkDetail(SuperRecordModel SRModel) {
        return  getSqlSession().selectList("MTrademarkDetailMapper.select",SRModel);
    }
}
